package comday03.itheima02;

public class Demo01循环跳转语句 {
    public static void main(String[] args) {
        //break和continue必须放在判断语句中，否则没有意义

        //输出1-10的循环
        for (int i = 1; i <= 10; i++) {
            if(i==5){
                continue;  //跳过本次循环，进入下次循环
            }
            System.out.println(i);
        }
        // 1 2 3 4 6 7 8 9 10


        //输出1-10的循环
        for (int i = 1; i <= 10; i++) {
            if(i==5){
                break;  //直接结束循环
            }
            System.out.println(i);
        }
        // 1 2 3 4
    }
}
